import { createRequestTypes } from '@UTILS/reduxHelper'

export const UPDATE_ORDER_STATUS = createRequestTypes('UPDATE_ORDER_STATUS')
export const UPDATE_SERVICE_PACE_ORDER_STATUS = createRequestTypes('UPDATE_SERVICE_PACE_ORDER_STATUS')
export const GET_ORDER_DETAIL = createRequestTypes('GET_ORDER_DETAIL')
export const GET_MY_CONSULTATION_ORDERS = createRequestTypes('GET_MY_CONSULTATION_ORDERS')
export const GET_MY_SERVICE_PACK_ORDERS = createRequestTypes('GET_MY_SERVICE_PACK_ORDERS')

export default {
  dispatchUpdateOrder(data) {
    return {
      type: UPDATE_ORDER_STATUS.REQUEST,
      data
    }
  },
  dispatchGetOrderDetail(orderId, isInit) {
    return {
      type: GET_ORDER_DETAIL.REQUEST,
      orderId,
      isInit
    }
  },
  dispatchGetMyConsultationOrders(payload) {
    return {
      type: GET_MY_CONSULTATION_ORDERS.REQUEST,
      payload
    }
  },
  dispatchGetMyServicePackOrders(payload) {
    return {
      type: GET_MY_SERVICE_PACK_ORDERS.REQUEST,
      payload
    }
  },
  dispatchUpdateServicePackOrder(data) {
    return {
      type: UPDATE_SERVICE_PACE_ORDER_STATUS.REQUEST,
      data
    }
  }
}
